<?php
//include_once 'xl_load_dl.php';
//$q = strtolower($_GET["term"]);
//$timkiem = new xl_load_dl();
//echo json_encode($timkiem->timKiemTen($q));
	require_once "config.php";
	$q = strtolower($_GET["term"]);
	$data=array();
	if (!$q) return;
		$sql="select * from nhomdiadiem where TenNhomDiaDiem like N'%".$q."%' order by TenNhomDiaDiem ASC limit 0,10";
		$result = mysql_query($sql);
		while( $rs= mysql_fetch_array($result,MYSQL_ASSOC)){
				$data[]=array("value" =>$rs['TenNhomDiaDiem'],"id"=>$rs['MaNhomDiaDiem']);
			}
		/*$sql = "select * from diadiem where TenDiaDiem like N'%".$q."%' order by TenDiaDiem ASC limit 0,10";
		$rsd = mysql_query($sql);
		while( $rs= mysql_fetch_array($rsd,MYSQL_ASSOC)) {
			$hienthi=$rs['TenDiaDiem'];
			$data[]=array("value" =>$hienthi,"id"=>$rs['TenDiaDiem']);
		}*/
	echo json_encode($data);